import request from '@/utils/request'
const urlPrefix = '/api/admin/'

//用户列表
export function userList(data) {
  return request({
    url: urlPrefix + 'userList',
    method: 'get',
    params: data
  })
}

//添加用户
export function userAdd(data) {
  return request({
    url: urlPrefix + 'userAdd',
    method: 'get',
    params: data
  })
}

//删除用户
export function userDel(data) {
  return request({
    url: urlPrefix + 'userDel',
    method: 'get',
    params: data
  })
}

//禁用用户
export function userDisable(data) {
  return request({
    url: urlPrefix + 'userDisable',
    method: 'get',
    params: data
  })
}

//导入设备
export function importDevice(data) {
  return request({
    url: urlPrefix + 'importDevice',
    method: 'post',
    params: data
  })
}

//设备列表
export function deviceList(data) {
  return request({
    url: urlPrefix + 'deviceList',
    method: 'post',
    params: data
  })
}

//下载列表
export function exportCsv(data) {
  return request({
    url: urlPrefix + 'exportCsv',
    method: 'post',
    params: data
  })
}

//禁用设备
export function deviceDisable(data) {
  return request({
    url: urlPrefix + 'deviceDisable',
    method: 'post',
    params: data
  })
}

//删除设备
export function deviceDel(id) {
  var data = {id:id}
  return request({
    url: urlPrefix + 'deviceDel',
    method: 'post',
    params: data
  })
}

//获取用户的流水
export function getUserCallDayFlow(data) {
  return request({
    url: urlPrefix + 'getUserCallDayFlow',
    method: 'post',
    params: data
  })
}

//获取设备的流水
export function getDeviceCallDayFlow(data) {
  return request({
    url: urlPrefix + 'getDeviceCallDayFlow',
    method: 'post',
    params: data
  })
}

//获取控制面板的信息
export function getDashBoardInfo() {
  return request({
    url: urlPrefix + 'getDashBoardInfo',
    method: 'post',
  })
}


export function sendMsg(data) {
  return request({
    url: '/api/admin/sendMsg',
    method: 'post',
    data
  })
}
